def task1(n):
    for i in range(n):
        print("正在搬第{}块砖".format(i))
        yield None
    return "没了1"


def task2(n):
    for i in range(n):
        print("正在听第{}首歌".format(i))
        yield None
    return "没了2"

t1 = task1(10)
t2 = task2(5)
while True:
    try:
        print(next(t1))
        print(next(t2))
    except Exception as err:
        print(err)
        break
